#include<iostream>
#include<cmath>

#include "global.hpp"
#include "solver.hpp"

using namespace std;
//typedef enum {
//  CGNS_ENUMV( BCTypeNull ) =CG_Null, used as nonBC
//  CGNS_ENUMV( BCTypeUserDefined ) =CG_UserDefined, used as BCOverset
//  CGNS_ENUMV( BCAxisymmetricWedge ) =2,
//  CGNS_ENUMV( BCDegenerateLine ) =3,
//  CGNS_ENUMV( BCDegeneratePoint ) =4,
//  CGNS_ENUMV( BCDirichlet ) =5,
//  CGNS_ENUMV( BCExtrapolate ) =6, used as PML
//  CGNS_ENUMV( BCFarfield ) =7, 
//  CGNS_ENUMV( BCGeneral ) =8,
//  CGNS_ENUMV( BCInflow ) =9, 
//  CGNS_ENUMV( BCInflowSubsonic ) =10,
//  CGNS_ENUMV( BCInflowSupersonic ) =11,
//  CGNS_ENUMV( BCNeumann ) =12,
//  CGNS_ENUMV( BCOutflow ) =13, 
//  CGNS_ENUMV( BCOutflowSubsonic ) =14,
//  CGNS_ENUMV( BCOutflowSupersonic ) =15,
//  CGNS_ENUMV( BCSymmetryPlane ) =16,
//  CGNS_ENUMV( BCSymmetryPolar ) =17,
//  CGNS_ENUMV( BCTunnelInflow ) =18,
//  CGNS_ENUMV( BCTunnelOutflow ) =19,
//  CGNS_ENUMV( BCWall ) =20,
//  CGNS_ENUMV( BCWallInviscid ) =21,
//  CGNS_ENUMV( BCWallViscous ) =22,
//  CGNS_ENUMV( BCWallViscousHeatFlux ) =23,
//  CGNS_ENUMV( BCWallViscousIsothermal ) =24,
//  CGNS_ENUMV( FamilySpecified ) =25, used as BCImpedance
//} CGNS_ENUMT( BCType_t );

void Solver::BCNull(double tRK, Mesh &msh, Node *node,Solution *sol,Flux *flux,Meanflow *mf){
    int iZone,iLZone,iLNode,iDim,iFace,iEq;
    int ijk[NDIM],iSt[NDIM],iEd[NDIM];
    int dN[NDIM],dI;
    #ifndef _2D
    double C[NEQ];
    #endif
    //Calculate the flux of the points which are in the wall regions
    for (iLZone=0;iLZone<msh.nLZone;++iLZone){
        iZone=msh.lZoneList[iLZone];
        dN[0]=1;
        dN[1]=msh.size[iZone][0];
        #ifndef _2D
        dN[2]=msh.size[iZone][0]*msh.size[iZone][1];
        #endif
        for (iFace=0;iFace<NFACE;++iFace){
            if (msh.bcTyp[iZone][iFace]==0){
                for (iDim=0;iDim<NDIM;++iDim){
                    iSt[iDim]=msh.faceRng[iZone][iFace][iDim][0];
                    iEd[iDim]=msh.faceRng[iZone][iFace][iDim][1];
                }
                //Only modify the most outer nodes

                #ifndef _2D     
                for (ijk[2]=iSt[2];ijk[2]<=iEd[2];++ijk[2])
                #endif
                for (ijk[1]=iSt[1];ijk[1]<=iEd[1];++ijk[1])
                for (ijk[0]=iSt[0];ijk[0]<=iEd[0];++ijk[0]){
                    iLNode=msh.caliLNode(iZone,ijk);
                    //Calculate space derivative of Q in computational domain
                    for (iEq=0;iEq<NEQ;++iEq){
                        (sol+iLNode)->Q[iEq]=0;
                    }
                }
            }
        }
    }
}